package flater.cairngormtips.controller.commands
{

import com.adobe.cairngorm.control.CairngormEvent;
import com.universalmind.cairngorm.commands.Command;

import flater.cairngormtips.controller.delegates.EventGeneratorExampleDelegate;
import flater.cairngormtips.util.out;

/**
 *  Downloads the config file for the application using 
 *  EventGeneratorExampleDelegate.<br/>
 *  <br/>
 *  Author: <a href="http://www.adamflater.net" target="_blank">
 *  Adam Flater</a>
 *  <br/>
 *  @see flater.cairngormtips.controller.delegates.EventGeneratorExampleDelegate
 *  @see flater.cairngormtips.EventGeneratorExampleApplication                                                                                          
 */
public class ConfigurationCommand extends Command
{
	public function ConfigurationCommand()
	{
		out( "ConfigurationCommand Instantiated" );
          
		super();
	}
	
	override public function execute( event : CairngormEvent ) : void
	{
        super.execute( event );
        
        out( "ConfigurationCommand.execute() invoked" );

		var delegate : EventGeneratorExampleDelegate = 
		                  new EventGeneratorExampleDelegate( this );
            delegate.getConfig();
	}
	
	override public function result( info : Object ) : void
	{
        out( "ConfigurationCommand.result() invoked" );
          
		var config : XML = info as XML;
		
		notifyCaller( config );
	}
	
} //  end class
} //  end package